﻿--ExistsCount
SELECT   COUNT(*) AS Expr1
FROM      dn_bn_dispensable
WHERE   (i_brand_name = ?) AND (i_gd_dispensable = ?)

--GetDataByName
SELECT i_brand_name, bt_is_abolish
FROM dn_brand_name
WHERE (c_cname = ?) AND (i_generic_drug = ?)

--InsertBrand
INSERT INTO dn_brand_name (i_brand_name, i_generic_drug, c_cname, c_search_code, c_ename, c_gd_cname, c_gd_ename, c_fdb_code, c_md_code, bt_is_abolish, bt_is_confirm, c_confirm_man, bt_is_package, MC_RECORD_CREATION_DATE) VALUES (?, ?, ?, '', '', '', '', '', '', 0, 0, '', 0, ?)

--GetDataByName
SELECT i_gd_dispensable, bt_is_abolish
FROM dn_gd_dispensable
WHERE (i_generic_drug = ?) AND (c_doseform = ?) AND (c_show_strength = ?)

--InsertDispensable
INSERT INTO dn_gd_dispensable (i_gd_dispensable, i_generic_drug, bt_is_selected, c_route, c_doseform, c_spec, c_spec_unit, c_md_code, bt_is_abolish, bt_is_confirm, c_confirm_man, c_ds_drugname, c_ds_doseform, c_ds_strength, c_ds_strength_unit, c_directions_title, c_show_strength, i_especial_drug_id, c_esp_drugname, c_esp_doseform, c_esp_strength, c_esp_strength_unit, MC_RECORD_CREATION_DATE) VALUES (?, ?, 0, '', ?, '', '', '', 0, 0, '', '', '', '', '', '', ?, 0, '', '', '', '', ?)

--备份
select * into dn_brand_name_bak20121209 from dn_brand_name
select * into dn_gd_dispensable_bak20121209 from dn_gd_dispensable
select * into dn_bn_dispensable_bak20121209 from dn_bn_dispensable


INSERT INTO dn_generic_drug (i_generic_drug, c_cname, c_search_code, c_ename) VALUES (?, ?, ?, ?)

INSERT INTO dbo.dn_other_name (i_other_name, i_generic_drug, c_name, c_search_code, c_name_type) VALUES (?, ?, ?, ?, ?)


SELECT i_generic_drug, c_cname, c_search_code, c_ename, bt_is_abolish FROM dbo.dn_generic_drug WHERE (c_cname = ?)

SELECT i_brand_name, i_generic_drug, c_cname, c_ename bt_is_abolish FROM dn_brand_name WHERE (c_cname = ?) AND (i_generic_drug = ?)

INSERT INTO dn_brand_name (i_brand_name, i_generic_drug, c_cname, c_search_code, c_ename) VALUES (?, ?, ?, ?, ?)

INSERT INTO dbo.dn_gd_dispensable (i_gd_dispensable, i_generic_drug, c_doseform, c_spec, c_spec_unit, c_show_strength) VALUES (?, ?, ?, '', '', ?)

SELECT i_gd_dispensable, bt_is_abolish FROM dn_gd_dispensable WHERE (i_generic_drug = ?) AND (c_doseform = ?) AND (c_show_strength = ?)

INSERT INTO [dn_bn_dispensable]([i_bn_dispensable],[i_brand_name],[i_gd_dispensable],[c_doseform]) VALUES (           )